package Main;

class Course {
    int id;
    String coursename;
    String place;
    float time;

    public Course(String coursename, int id, String place, float time) {
        this.id = id;
        this.coursename = coursename;
        this.place = place;
        this.time = time;
    }

    public String toString() {
        return coursename + "(课程名)" + "     课程编号：" + id + "   上课地点：" + place
                + "    课程时间：" + time + "min";
    }
}
class Person {
    public int number;
    protected String name;
    protected String sex;

    protected Person(int number, String name, String sex) {
        this.number = number;
        this.name = name;
        this.sex = sex;

    }
}

class Student extends Person {
    String c;
    public Student(int number, String name,String sex) {
        super(number,name,sex);
        this.number = number;
        this.name = name;
        this.sex = sex;
    }

    public String toString(){
        return "Student(学生信息):  姓名：" + name + "    学号：" + number + "   性别：" + sex ;
    }
    void tuike() {
        c=null;
    }
    void delete() {
        if(c== null);{
            System.out.println("学生目前未选课");}

    }
}

class Teacher extends Person {
    String lesson;

    public Teacher(int number, String name, String sex, String lesson) {
        super(number, name, sex);
        this.number = number;
        this.name = name;
        this.sex = sex;
        this.lesson = lesson;
    }

    public String toString() {
        return "Teacher(教师信息):" + "  编号：" + number + "    姓名：" + name + "   性别：" + sex + "     所授课程：" + lesson;
    }

}
class Text {
    public static void main(String[] args) {
        Student me = new Student(2021311192, "张三", "MAN");
        System.out.println("学生信息");
        System.out.println(me);
        Teacher b = new Teacher(2021100, "李四", "MAN", "篮球");
        System.out.println("教师信息");
        System.out.println(b);
        Course c = new Course("篮球", 110, "操场", 60f);
        System.out.println("课程信息");
        System.out.println(c);
        me.tuike();
        me.delete();

    }
}